Skip to content

feat(plugin): add adaptive performance mode for hooks (#1002)#1027

Merged
JeremyDev87 merged 1 commit into
masterfrom
feat/adaptive-perf-1002
Mar 27, 2026
Merged

feat(plugin): add adaptive performance mode for hooks (#1002)#1027
JeremyDev87 merged 1 commit into
masterfrom
feat/adaptive-perf-1002

Conversation

@JeremyDev87

Copy link
Copy Markdown
Owner

Summary

  • 훅 실행 시간이 임계값을 초과하면 자동으로 경량 모드로 전환하여 사용자 경험을 보호
  • 경량 모드에서는 무거운 분석(conflict prediction, full project scan, file watcher)을 스킵하고 핵심 기능(mode detection, basic validation)만 유지
  • codingbuddy.config.jsonhooks.timeoutMs로 임계값 설정 가능 (기본값: 10000ms)
  • Sliding window 기반 성능 모니터링으로 자동 복귀 지원
  • 다국어 알림 지원 (en/ko/ja/zh/es)

Changes

  • packages/claude-code-plugin/hooks/lib/adaptive_perf.py — 핵심 모니터 모듈 (singleton, sliding window, mode switching)
  • packages/claude-code-plugin/hooks/session-start.py — project scan/agent recommendations를 경량 모드에서 스킵
  • packages/claude-code-plugin/hooks/pre-tool-use.py — file watcher를 경량 모드에서 스킵
  • packages/claude-code-plugin/hooks/tests/test_adaptive_perf.py — 27개 테스트

Test plan

  • 27 unit tests passing (python3 -m pytest packages/claude-code-plugin/hooks/tests/test_adaptive_perf.py -v)
  • Manual: session-start with high latency simulated
  • Manual: pre-tool-use with lightweight mode active

Closes #1002

When hook execution time exceeds threshold, auto-switch to lightweight
mode that skips heavy analysis (conflict prediction, full project scan)
while keeping core functions (mode detection, basic validation).

- Add adaptive_perf.py with sliding-window performance monitor
- Integrate into session-start.py (skip project scan in lightweight mode)
- Integrate into pre-tool-use.py (skip file watcher in lightweight mode)
- Configurable threshold via codingbuddy.config.json (hooks.timeoutMs)
- User notification on mode switch (i18n: en/ko/ja/zh/es)
- 27 tests passing
@JeremyDev87 JeremyDev87 added the wave-4 Wave 4: Polish (parallel) label Mar 27, 2026
@vercel

vercel Bot commented Mar 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Mar 27, 2026 5:38pm

@JeremyDev87 JeremyDev87 self-assigned this Mar 27, 2026
@JeremyDev87 JeremyDev87 merged commit c710c48 into master Mar 27, 2026
28 checks passed
@JeremyDev87 JeremyDev87 deleted the feat/adaptive-perf-1002 branch March 27, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wave-4 Wave 4: Polish (parallel)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(plugin): add adaptive performance mode for hooks

1 participant